package com.kuding.config;

import com.kuding.oss.kodo.QiniuyunKodoComponent;
import com.kuding.props.qiniuyun.QiniuyunKodoProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(name = "sys.enable-qiniuyun-kodo", havingValue = "true")
@EnableConfigurationProperties({ QiniuyunKodoProperty.class })
public class QiniuyunKodoComponentConfig {

	@Autowired
	private QiniuyunKodoProperty qiniuyunKodoProperty;

	@Bean
	public QiniuyunKodoComponent kodoComponent() {
		QiniuyunKodoComponent kodoComponent = new QiniuyunKodoComponent(qiniuyunKodoProperty);
		return kodoComponent;
	}
}
